<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>DataFormatter (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="DataFormatter (POI API Documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DataFormatter.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html" title="interface in org.apache.poi.ss.usermodel"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/ss/usermodel/DataValidation.html" title="interface in org.apache.poi.ss.usermodel"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/ss/usermodel/DataFormatter.html" target="_top">FRAMES</a></li>
<li><a href="DataFormatter.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.ss.usermodel</p>
<h2 title="Class DataFormatter" class="title">Class DataFormatter</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.poi.ss.usermodel.DataFormatter</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFDataFormatter.html" title="class in org.apache.poi.hssf.usermodel">HSSFDataFormatter</a></dd>
</dl>
<hr>
<br>
<pre>public class <strong>DataFormatter</strong>
extends java.lang.Object</pre>
<div class="block">DataFormatter contains methods for formatting the value stored in an
 Cell. This can be useful for reports and GUI presentations when you
 need to display data exactly as it appears in Excel. Supported formats
 include currency, SSN, percentages, decimals, dates, phone numbers, zip
 codes, etc.
 <p>
 Internally, formats will be implemented using subclasses of <code>Format</code>
 such as <code>DecimalFormat</code> and <code>SimpleDateFormat</code>. Therefore the
 formats used by this class must obey the same pattern rules as these Format
 subclasses. This means that only legal number pattern characters ("0", "#",
 ".", "," etc.) may appear in number formats. Other characters can be
 inserted <em>before</em> or <em> after</em> the number pattern to form a
 prefix or suffix.
 </p>
 <p>
 For example the Excel pattern <code>"$#,##0.00 "USD"_);($#,##0.00 "USD")"
 </code> will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)".
 However the pattern <code>"00-00-00"</code> is incorrectly formatted by
 DecimalFormat as "000000--". For Excel formats that are not compatible with
 DecimalFormat, you can provide your own custom <code>Format</code> implementation
 via <code>DataFormatter.addFormat(String,Format)</code>. The following
 custom formats are already provided by this class:
 </p>
 <pre>
 <ul><li>SSN "000-00-0000"</li>
     <li>Phone Number "(###) ###-####"</li>
     <li>Zip plus 4 "00000-0000"</li>
 </ul>
 </pre>
 <p>
 If the Excel format pattern cannot be parsed successfully, then a default
 format will be used. The default number format will mimic the Excel General
 format: "#" for whole numbers and "#.##########" for decimal numbers. You
 can override the default format pattern with <code>
 DataFormatter.setDefaultNumberFormat(Format)</code>. <b>Note:</b> the
 default format will only be used when a Format cannot be created from the
 cell's data format string.

 <p>
 Note that by default formatted numeric values are trimmed.
 Excel formats can contain spacers and padding and the default behavior is to strip them off.
 </p>
 <p>Example:</p>
 <p>
 Consider a numeric cell with a value <code>12.343</code> and format <code>"##.##_ "</code>.
  The trailing underscore and space ("_ ") in the format adds a space to the end and Excel formats this cell as <code>"12.34 "</code>,
  but <code>DataFormatter</code> trims the formatted value and returns <code>"12.34"</code>.
 </p>
 You can enable spaces by passing the <code>emulateCsv=true</code> flag in the <code>DateFormatter</code> cosntructor.
 If set to true, then the output tries to conform to what you get when you take an xls or xlsx in Excel and Save As CSV file:
 <ul>
  <li>returned values are not trimmed</li>
  <li>Invalid dates are formatted as  255 pound signs ("#")</li>
  <li>simulate Excel's handling of a format string of all # when the value is 0.
   Excel will output "", <code>DataFormatter</code> will output "0".
 </ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#DataFormatter()">DataFormatter</a></strong>()</code>
<div class="block">Creates a formatter using the <code>default locale</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#DataFormatter(boolean)">DataFormatter</a></strong>(boolean&nbsp;emulateCsv)</code>
<div class="block">Creates a formatter using the <code>default locale</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#DataFormatter(java.util.Locale)">DataFormatter</a></strong>(java.util.Locale&nbsp;locale)</code>
<div class="block">Creates a formatter using the given locale.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#DataFormatter(java.util.Locale, boolean)">DataFormatter</a></strong>(java.util.Locale&nbsp;locale,
             boolean&nbsp;emulateCsv)</code>
<div class="block">Creates a formatter using the given locale.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#addFormat(java.lang.String, java.text.Format)">addFormat</a></strong>(java.lang.String&nbsp;excelFormatStr,
         java.text.Format&nbsp;format)</code>
<div class="block">Adds a new format to the available formats.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.text.Format</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#createFormat(org.apache.poi.ss.usermodel.Cell)">createFormat</a></strong>(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell)</code>
<div class="block">Create and return a Format based on the format string from a  cell's
 style.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue(org.apache.poi.ss.usermodel.Cell)">formatCellValue</a></strong>(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell)</code>
<div class="block">
 Returns the formatted value of a cell as a <tt>String</tt> regardless
 of the cell type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue(org.apache.poi.ss.usermodel.Cell, org.apache.poi.ss.usermodel.FormulaEvaluator)">formatCellValue</a></strong>(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell,
               <a href="../../../../../org/apache/poi/ss/usermodel/FormulaEvaluator.html" title="interface in org.apache.poi.ss.usermodel">FormulaEvaluator</a>&nbsp;evaluator)</code>
<div class="block">
 Returns the formatted value of a cell as a <tt>String</tt> regardless
 of the cell type.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatRawCellContents(double, int, java.lang.String)">formatRawCellContents</a></strong>(double&nbsp;value,
                     int&nbsp;formatIndex,
                     java.lang.String&nbsp;formatString)</code>
<div class="block">Formats the given raw cell value, based on the supplied
  format index and string, according to excel style rules.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatRawCellContents(double, int, java.lang.String, boolean)">formatRawCellContents</a></strong>(double&nbsp;value,
                     int&nbsp;formatIndex,
                     java.lang.String&nbsp;formatString,
                     boolean&nbsp;use1904Windowing)</code>
<div class="block">Formats the given raw cell value, based on the supplied
  format index and string, according to excel style rules.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.text.Format</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#getDefaultFormat(org.apache.poi.ss.usermodel.Cell)">getDefaultFormat</a></strong>(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell)</code>
<div class="block">Returns a default format for a cell.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#setDefaultNumberFormat(java.text.Format)">setDefaultNumberFormat</a></strong>(java.text.Format&nbsp;format)</code>
<div class="block">
 Sets a default number format to be used when the Excel format cannot be
 parsed successfully.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#setExcelStyleRoundingMode(java.text.DecimalFormat)">setExcelStyleRoundingMode</a></strong>(java.text.DecimalFormat&nbsp;format)</code>
<div class="block">Enables excel style rounding mode (round half up) on the 
  Decimal Format given.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#setExcelStyleRoundingMode(java.text.DecimalFormat, java.math.RoundingMode)">setExcelStyleRoundingMode</a></strong>(java.text.DecimalFormat&nbsp;format,
                         java.math.RoundingMode&nbsp;roundingMode)</code>
<div class="block">Enables custom rounding mode on the given Decimal Format.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="DataFormatter()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DataFormatter</h4>
<pre>public&nbsp;DataFormatter()</pre>
<div class="block">Creates a formatter using the <code>default locale</code>.</div>
</li>
</ul>
<a name="DataFormatter(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DataFormatter</h4>
<pre>public&nbsp;DataFormatter(boolean&nbsp;emulateCsv)</pre>
<div class="block">Creates a formatter using the <code>default locale</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>emulateCsv</code> - whether to emulate CSV output.</dd></dl>
</li>
</ul>
<a name="DataFormatter(java.util.Locale, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DataFormatter</h4>
<pre>public&nbsp;DataFormatter(java.util.Locale&nbsp;locale,
             boolean&nbsp;emulateCsv)</pre>
<div class="block">Creates a formatter using the given locale.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>emulateCsv</code> - whether to emulate CSV output.</dd></dl>
</li>
</ul>
<a name="DataFormatter(java.util.Locale)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DataFormatter</h4>
<pre>public&nbsp;DataFormatter(java.util.Locale&nbsp;locale)</pre>
<div class="block">Creates a formatter using the given locale.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="createFormat(org.apache.poi.ss.usermodel.Cell)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createFormat</h4>
<pre>public&nbsp;java.text.Format&nbsp;createFormat(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell)</pre>
<div class="block">Create and return a Format based on the format string from a  cell's
 style. If the pattern cannot be parsed, return a default pattern.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cell</code> - The Excel cell</dd>
<dt><span class="strong">Returns:</span></dt><dd>A Format representing the excel format. May return null.</dd></dl>
</li>
</ul>
<a name="getDefaultFormat(org.apache.poi.ss.usermodel.Cell)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultFormat</h4>
<pre>public&nbsp;java.text.Format&nbsp;getDefaultFormat(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell)</pre>
<div class="block">Returns a default format for a cell.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cell</code> - The cell</dd>
<dt><span class="strong">Returns:</span></dt><dd>a default format</dd></dl>
</li>
</ul>
<a name="formatRawCellContents(double, int, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>formatRawCellContents</h4>
<pre>public&nbsp;java.lang.String&nbsp;formatRawCellContents(double&nbsp;value,
                                     int&nbsp;formatIndex,
                                     java.lang.String&nbsp;formatString)</pre>
<div class="block">Formats the given raw cell value, based on the supplied
  format index and string, according to excel style rules.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue(org.apache.poi.ss.usermodel.Cell)"><code>formatCellValue(Cell)</code></a></dd></dl>
</li>
</ul>
<a name="formatRawCellContents(double, int, java.lang.String, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>formatRawCellContents</h4>
<pre>public&nbsp;java.lang.String&nbsp;formatRawCellContents(double&nbsp;value,
                                     int&nbsp;formatIndex,
                                     java.lang.String&nbsp;formatString,
                                     boolean&nbsp;use1904Windowing)</pre>
<div class="block">Formats the given raw cell value, based on the supplied
  format index and string, according to excel style rules.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue(org.apache.poi.ss.usermodel.Cell)"><code>formatCellValue(Cell)</code></a></dd></dl>
</li>
</ul>
<a name="formatCellValue(org.apache.poi.ss.usermodel.Cell)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>formatCellValue</h4>
<pre>public&nbsp;java.lang.String&nbsp;formatCellValue(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell)</pre>
<div class="block"><p>
 Returns the formatted value of a cell as a <tt>String</tt> regardless
 of the cell type. If the Excel format pattern cannot be parsed then the
 cell value will be formatted using a default format.
 </p>
 <p>When passed a null or blank cell, this method will return an empty
 String (""). Formulas in formula type cells will not be evaluated.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cell</code> - The cell</dd>
<dt><span class="strong">Returns:</span></dt><dd>the formatted cell value as a String</dd></dl>
</li>
</ul>
<a name="formatCellValue(org.apache.poi.ss.usermodel.Cell, org.apache.poi.ss.usermodel.FormulaEvaluator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>formatCellValue</h4>
<pre>public&nbsp;java.lang.String&nbsp;formatCellValue(<a href="../../../../../org/apache/poi/ss/usermodel/Cell.html" title="interface in org.apache.poi.ss.usermodel">Cell</a>&nbsp;cell,
                               <a href="../../../../../org/apache/poi/ss/usermodel/FormulaEvaluator.html" title="interface in org.apache.poi.ss.usermodel">FormulaEvaluator</a>&nbsp;evaluator)</pre>
<div class="block"><p>
 Returns the formatted value of a cell as a <tt>String</tt> regardless
 of the cell type. If the Excel format pattern cannot be parsed then the
 cell value will be formatted using a default format.
 </p>
 <p>When passed a null or blank cell, this method will return an empty
 String (""). Formula cells will be evaluated using the given
 <a href="../../../../../org/apache/poi/ss/usermodel/FormulaEvaluator.html" title="interface in org.apache.poi.ss.usermodel"><code>FormulaEvaluator</code></a> if the evaluator is non-null. If the
 evaluator is null, then the formula String will be returned. The caller
 is responsible for setting the currentRow on the evaluator
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cell</code> - The cell (can be null)</dd><dd><code>evaluator</code> - The FormulaEvaluator (can be null)</dd>
<dt><span class="strong">Returns:</span></dt><dd>a string value of the cell</dd></dl>
</li>
</ul>
<a name="setDefaultNumberFormat(java.text.Format)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDefaultNumberFormat</h4>
<pre>public&nbsp;void&nbsp;setDefaultNumberFormat(java.text.Format&nbsp;format)</pre>
<div class="block"><p>
 Sets a default number format to be used when the Excel format cannot be
 parsed successfully. <b>Note:</b> This is a fall back for when an error
 occurs while parsing an Excel number format pattern. This will not
 affect cells with the <em>General</em> format.
 </p>
 <p>
 The value that will be passed to the Format's format method (specified
 by <code>java.text.Format#format</code>) will be a double value from a
 numeric cell. Therefore the code in the format method should expect a
 <code>Number</code> value.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>format</code> - A Format instance to be used as a default</dd><dt><span class="strong">See Also:</span></dt><dd><code>Format.format(java.lang.Object)</code></dd></dl>
</li>
</ul>
<a name="addFormat(java.lang.String, java.text.Format)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addFormat</h4>
<pre>public&nbsp;void&nbsp;addFormat(java.lang.String&nbsp;excelFormatStr,
             java.text.Format&nbsp;format)</pre>
<div class="block">Adds a new format to the available formats.
 <p>
 The value that will be passed to the Format's format method (specified
 by <code>java.text.Format#format</code>) will be a double value from a
 numeric cell. Therefore the code in the format method should expect a
 <code>Number</code> value.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>excelFormatStr</code> - The data format string</dd><dd><code>format</code> - A Format instance</dd></dl>
</li>
</ul>
<a name="setExcelStyleRoundingMode(java.text.DecimalFormat)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExcelStyleRoundingMode</h4>
<pre>public static&nbsp;void&nbsp;setExcelStyleRoundingMode(java.text.DecimalFormat&nbsp;format)</pre>
<div class="block">Enables excel style rounding mode (round half up) on the 
  Decimal Format given.</div>
</li>
</ul>
<a name="setExcelStyleRoundingMode(java.text.DecimalFormat, java.math.RoundingMode)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setExcelStyleRoundingMode</h4>
<pre>public static&nbsp;void&nbsp;setExcelStyleRoundingMode(java.text.DecimalFormat&nbsp;format,
                             java.math.RoundingMode&nbsp;roundingMode)</pre>
<div class="block">Enables custom rounding mode on the given Decimal Format.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>format</code> - DecimalFormat</dd><dd><code>roundingMode</code> - RoundingMode</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DataFormatter.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html" title="interface in org.apache.poi.ss.usermodel"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/ss/usermodel/DataValidation.html" title="interface in org.apache.poi.ss.usermodel"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/ss/usermodel/DataFormatter.html" target="_top">FRAMES</a></li>
<li><a href="DataFormatter.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            </small></p>
</body>
</html>
